﻿<views:MvxWpfView 
	x:Class="Sidvall.IdentityManager.UI.Wpf.Views.InformationView"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
	xmlns:views="clr-namespace:MvvmCross.Wpf.Views;assembly=MvvmCross.Wpf"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:vms="clr-namespace:Sidvall.IdentityManager.UI.ViewModels;assembly=Sidvall.IdentityManager.UI"
	xmlns:Converters="clr-namespace:Sidvall.UI.Wpf.Converters;assembly=Sidvall.UI.Wpf"
	xmlns:Custom="http://schemas.odyssey.com/wpf" 
	xmlns:local="clr-namespace:Sidvall.IdentityManager.UI.Wpf.Views"
	xmlns:sys="clr-namespace:System;assembly=mscorlib"
	xmlns:Controls="clr-namespace:Sidvall.IdentityManager.UI.Wpf.Controls" 
	xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
	mc:Ignorable="d" 
	d:DesignHeight="500" d:DesignWidth="600">

	<views:MvxWpfView.Resources>
		<Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
		<Converters:BooleanToVisibilityConverter x:Key="NotBooleanToVisibilityConverter" Not="True"/>
	</views:MvxWpfView.Resources>

	<Grid d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type vms:InformationViewModel}}">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition/>
		</Grid.RowDefinitions>

		<Controls:HeaderControl HeaderCaption="Information" />

		<Grid Grid.Row="1">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>

				<StackPanel>
					<Controls:SubHeaderControl Margin="5,5,5,0" HeaderCaption="{Binding SubTitle}" />
					<Grid Margin="5,5,5,0">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="130" />
							<ColumnDefinition />
						</Grid.ColumnDefinitions>
						<Image Source="/Sidvall.IdentityManager.UI.Wpf;component/Application.ico" VerticalAlignment="Top" />
						<StackPanel Grid.Column="1">
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="130" />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>

								<Label Grid.Column="0" Content="Created:" />
								<TextBlock Grid.Column="1" Text="{Binding Created}" VerticalAlignment="Center" />
							</Grid>
							<Grid Margin="0,5,0,0">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="130" />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>

								<Label Grid.Column="0" Content="Version:" />
								<TextBlock Grid.Column="1" Text="{Binding Version}" VerticalAlignment="Center" />
							</Grid>
							<Grid Margin="0,5,0,0">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="130" />
									<ColumnDefinition />
									<ColumnDefinition Width="Auto" />
								</Grid.ColumnDefinitions>

								<Label Grid.Column="0" Content="File version:" />
								<TextBlock Grid.Column="1" Text="{Binding FileVersion}" VerticalAlignment="Center" />
								<TextBlock Grid.Column="2">
									<Hyperlink Command="{Binding ShowNewsCommand}">
										View news
									</Hyperlink>
								</TextBlock>
							</Grid>
							<Grid Margin="0,5,0,0">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="130" />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>

								<Label Grid.Column="0" Content="About:" />
								<TextBox Grid.Column="1" IsReadOnly="True" Height="80" Text="{Binding AboutText}" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" />
							</Grid>
						</StackPanel>
					</Grid>
					<Controls:SubHeaderControl Margin="5,5,5,0" HeaderCaption="Server" />
					<Grid Margin="5,5,5,0">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="130" />
							<ColumnDefinition />
						</Grid.ColumnDefinitions>
						<Grid>
						</Grid>
						<StackPanel Grid.Column="1">
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="130" />
									<ColumnDefinition Width="Auto" />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>

								<Label Grid.Column="0" Content="Connection:" />
								<Image Grid.Column="1" Source="/Sidvall.IdentityManager.UI.Wpf;component/Images/OK.png" Width="24" Visibility="{Binding ServerItem.IsLoadedServer, Converter={StaticResource BooleanToVisibilityConverter}}" />
								<Image Grid.Column="1" Source="/Sidvall.IdentityManager.UI.Wpf;component/Images/Error.png" Width="24" Visibility="{Binding ServerItem.IsLoadedServer, Converter={StaticResource NotBooleanToVisibilityConverter}}" />
							</Grid>
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="130" />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>

								<Label Grid.Column="0" Content="Name:" />
								<TextBlock Grid.Column="1" Text="{Binding ServerItem.ServerComment}" VerticalAlignment="Center" />
							</Grid>
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="130" />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>

								<Label Grid.Column="0" Content="Logged on as:" />
								<TextBlock Grid.Column="1" Text="{Binding ServerContent.UserName}" VerticalAlignment="Center" />
							</Grid>
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="130" />
									<ColumnDefinition Width="Auto" />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>

								<TextBlock Grid.Column="1">
									<Hyperlink Command="{Binding ShowUserConfigurationCommand}">
										Settings
									</Hyperlink>
								</TextBlock>
							</Grid>
						</StackPanel>
					</Grid>
				</StackPanel>
			</Grid>
		</Grid>
	</Grid>
</views:MvxWpfView>
